function root(i:double; k:longint):double;
begin
if k<1 then result:=0 else begin
  result:=exp(ln(abs(i))/k);
  if odd(k) and (i<0) then result:=-result else
  if (not odd(k)) and (i<0) then result:=0;
end;
end;